<html>

<head>
<title>我的一个 HTML 页面</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<style>
table tr td{text-align:center; height: 40px;}
</style>
<script src="jquery-1.10.js"></script>
<script>
function  loginAction(){
	var username = $("#username").val();
	var password = $("#password").val();
	
	$.ajax({
		type:"post",
		url:"loginAction.php",
		data:{username:username, password:password},
		success:function(data){
			if(data)
			{
				location.href="loginSuccess.html";
			}
		}
	});
}

function  registAction(){
	var username = $("#username").val();
	var password = $("#password").val();
	
	$.ajax({
		type:"post",
		url:"registAction.php",
		data:{username:username, password:password},
		success:function(data){
			if(data)
			{
				location.href="registSuccess.html";
			}
		}
	});
}
</script>
</head>

<body>
<div style="width: 330px;margin: 0 auto;">
	<table>
		<tr>
			<td colspan="2">
				<img src="logo.png"/>
			</td>
		</tr>
		<tr>
			<td>用户名：</td>
			<td><input type="text" name="username" id="username" /></td>
		</tr>
		<tr>
			<td>密　码：</td>
			<td><input type="password" name="password" id="password" /></td>
		</tr>
		<tr>
			<td colspan="2">
				<div style="float: left;margin-left: 55px;"><input type="button" value="登录" onclick="loginAction()"/></div>
				<div style="float: left;margin-left: 40px;"><input type="button" value="注册" onclick="registAction()"/></div>
			</td>
		</tr>
	</table>
</div>

</body>

</html>